package com.rong.maven01demo.control;

import com.rong.maven01demo.dao.User;
import com.rong.maven01demo.mapper.UserMapper;
import com.rong.maven01demo.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/user")
@RestController
public class UserController {

    private Logger log = LoggerFactory.getLogger(UserController.class);

    @Autowired
    private UserService userService;

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/get")
    public List<User> getUsers(){
        List<User> list = userMapper.selectUsers();
        log.info(list.toString());

        return list;
    }
}
